<?php
namespace App\Console; use App\System; use Carbon\Carbon; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Schema; class Kernel extends ConsoleKernel { protected $commands = array(); protected function schedule(Schedule $spad4e18) { if (!app()->runningInConsole()) { return; } try { System::_init(); } catch (\Throwable $spc22b6c) { return; } if (System::_getInt('order_clean_unpay_open') === 1) { $sp0d78d7 = System::_getInt('order_clean_unpay_day', 7); $spad4e18->call(function () use($sp0d78d7) { echo '[' . date('Y-m-d H:i:s') . "] cleaning unpaid orders({$sp0d78d7} days ago)...\n"; \App\Order::where('status', \App\Order::STATUS_UNPAY)->where('created_at', '<', (new Carbon())->addDays(-$sp0d78d7))->delete(); $spf12c49 = '[' . date('Y-m-d H:i:s') . '] unpaid-orders cleaned 
'; echo $spf12c49; })->dailyAt('01:00'); } $spad4e18->call(function () { $sp0d78d7 = 7; echo '[' . date('Y-m-d H:i:s') . "] cleaning deleted cards({$sp0d78d7} days ago)...\n"; \App\Card::onlyTrashed()->where('deleted_at', '<', (new Carbon())->addDays(-$sp0d78d7))->forceDelete(); $spf12c49 = '[' . date('Y-m-d H:i:s') . '] deleted-cards cleaned
'; echo $spf12c49; })->dailyAt('02:00'); } protected function commands() { $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } }